package com.cardone.platform.common.service;

import java.util.List;
import java.util.Map;

import org.springframework.cache.annotation.CacheEvict;
import org.springframework.cache.annotation.Cacheable;

import com.cardone.common.cache.support.CacheEvictSupport;
import com.cardone.common.dto.PaginationDto;
import com.cardone.common.cache.Caches;
import com.cardone.platform.common.dto.EntityFileDto;

/**
 * 实体文件服务
 *
 * @author yaohaitao
 */
public interface EntityFileService {
	/**
	 * spring bean id
	 */
	String BEAN_ID = "com.cardone.platform.common.service.EntityFileService";

	/**
	 * 保存:实体文件
	 * 
	 * @param mappedClass
	 *            返回类型
	 * 
	 * @param saveEntityFile
	 *            实体文件对象
	 * 
	 * @return 实体文件对象
	 */
	@Deprecated
	@CacheEvict(value = EntityFileService.BEAN_ID, allEntries = true)
	<P> P saveByIdOrCode(Class<P> mappedClass, EntityFileDto saveEntityFile);

	/**
	 * 保存:实体文件
	 * 
	 * @param saveEntityFile
	 *            实体文件对象
	 * 
	 * @return 实体文件对象
	 */
	@Deprecated
	@CacheEvict(value = EntityFileService.BEAN_ID, allEntries = true)
	EntityFileDto saveByIdOrCode(EntityFileDto saveEntityFile);

	/**
	 * 插入
	 * 
	 * @param insertEntityFile
	 *            实体文件对象
	 * 
	 * @return 影响行数
	 */
	@Deprecated
	@CacheEvict(value = EntityFileService.BEAN_ID, allEntries = true)
	int insertByCode(EntityFileDto insertEntityFile);
	
	/**
	 * 删除
	 * 
	 * @param deleteEntityFile
	 *            实体文件对象
	 * 
	 * @return 影响行数
	 */
	@Deprecated
	@CacheEvict(value = EntityFileService.BEAN_ID, allEntries = true)
	int deleteByIds(EntityFileDto deleteEntityFile);

	/**
	 * 更新
	 * 
	 * @param updateEntityFile
	 *            实体文件对象
	 * 
	 * @return 影响行数
	 */
	@Deprecated
	@CacheEvict(value = EntityFileService.BEAN_ID, allEntries = true)
	int updateByCode(EntityFileDto updateEntityFile);

	/**
	 * 查询
	 * 
	 * @param requiredType
	 *            返回类型
	 * 
	 * @param readEntityFile
	 *            实体文件对象
	 * @return 返回数据
	 */
	@Deprecated
	@Cacheable(value = EntityFileService.BEAN_ID, key = Caches.KEY_1)
	Integer readByCodeNqIdForCount(EntityFileDto readEntityFile);
	
	/**
	 * 查询
	 * 
	 * @param mappedClass
	 *            返回类型
	 * 
	 * @param findEntityFile
	 *            实体文件对象
	 * @return 返回对象
	 */
	@Deprecated
	@Cacheable(value = EntityFileService.BEAN_ID, key = Caches.KEY_2)
	<P> P findById(Class<P> mappedClass, EntityFileDto findEntityFile);

	/**
	 * 查询
	 * 
	 * @param mappedClass
	 *            返回类型
	 * 
	 * @param findEntityFile
	 *            实体文件对象
	 * 
	 * @return 返回对象
	 */
	@Deprecated
	@Cacheable(value = EntityFileService.BEAN_ID, key = Caches.KEY_2)
	<P> P findByCodeOrId(Class<P> mappedClass, EntityFileDto findEntityFile);

	/**
	 * 查询
	 * 
	 * @param mappedClass
	 *            返回类型
	 * 
	 * @param findListEntityFile
	 *            实体文件对象
	 * 
	 * @return 实体文件对象集合
	 */
	@Deprecated
	@Cacheable(value = EntityFileService.BEAN_ID, key = Caches.KEY_2)
	<P> List<P> findListByLikeCode(Class<P> mappedClass, EntityFileDto findListEntityFile);

	/**
	 * 查询
	 * 
	 * @param mappedClass
	 *            返回类型
	 * 
	 * @return 实体文件对象集合
	 */
	@Deprecated
	@Cacheable(value = EntityFileService.BEAN_ID, key = Caches.KEY_1)
	<P> List<P> findList(Class<P> mappedClass);

	/**
	 * 分页
	 * 
	 * @param mappedClass
	 *            返回类型
	 * 
	 * @param paginationEntityFile
	 *            实体文件对象
	 * 
	 * @return 实体文件分页对象
	 */
	@Deprecated
	@Cacheable(value = EntityFileService.BEAN_ID, key = Caches.KEY_2)
	<P> PaginationDto<P> paginationByLikeCode(Class<P> mappedClass, EntityFileDto paginationEntityFile);
}